namespace System.Collections.Generic
{
    public static class HashSetExtension
    {
        public static HashSet<T> Clone<T>(this HashSet<T> hashSet)
        {
            return new HashSet<T>(hashSet);
        }

        public static List<T> ToList<T>(this HashSet<T> hashSet)
        {
            List<T> list = new List<T>(hashSet.Count);
            foreach (T item in hashSet)
            {
                list.Add(item);
            }
            return list;
        }
    }
}
